import { http } from '@/utils/http';
import type { ApiResponse, Activity, ActivityVoteStatistics } from '@/types';

// 获取当前活动
export const getCurrentActivity = (): Promise<ApiResponse<Activity>> => {
  return http.get('/client/votes/current-activity');
};

// 获取活动投票排行榜
export const getActivityVoteLeaderboard = (
  activityId: number,
  params?: { limit?: number }
): Promise<ApiResponse<{
  activity: Activity;
  leaderboard: any[];
}>> => {
  return http.get(`/client/votes/activity/${activityId}/leaderboard`, { params });
};

// 获取活动投票统计
export const getActivityVoteStatistics = (
  activityId: number
): Promise<ApiResponse<ActivityVoteStatistics>> => {
  return http.get(`/client/votes/activity/${activityId}/statistics`);
};
